<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

// 注册登录
Route::get('login', ['uses' => 'Auth\AuthController@getLogin']);
Route::post('login', ['uses' => 'Auth\AuthController@postLogin']);
Route::get('reg', ['uses' => 'Auth\AuthController@getRegister']);
Route::post('reg', ['uses' => 'Auth\AuthController@postRegister']);
Route::post('ajaxLogin', ['uses' => 'Auth\AuthController@postAjaxLogin']);
Route::get('logout', ['uses' => 'Auth\AuthController@getLogout']);

//首页
Route::get('/', 'WelcomeController@index');

//管理系统
Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware'=>['auth','isadmin']], function () {
    Route::get('', 'DashController@index');
    Route::get('categories', 'CategoriesController@index');
    Route::get('articles', 'ArticlesController@index');
});